#include <iostream>
using namespace std;
int n,m;
const int N=1e6+10;
int a[N];
int mp[N];
int main()
{
    cin>>n>>m;
    for(int i=1;i<=n;i++)
    {
        cin>>a[i];
    }
    int left=1;int right=1;
    int kind=0;
    int ret=n;
    int start=1;
    while(right<=n)
    {
        if(mp[a[right]]++==0)
            kind++;
        while(kind==m)
        {
            int len=right-left+1;
            if(ret>len)
            {
                start=left;
                ret=len;
            }
            if(mp[a[left]]--==1)kind--;
            left++;

        }
        right++;
    }
    cout<<start<<" "<<start+ret-1;
    return 0;
}
